<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="example">
    <my-component></my-component>
</div>
<script>
//    <!--定义-->
    var MyComponent=Vue.extend({
       template:'<div>A custom component</div>'
    })
//    注册
    Vue.component('my-component',MyComponent)

//    创建根实例
    new Vue({
        el:'#example'
    })
</script>
</body>
</html>